package Class::Scaffold::Exception::Util;

# $Id: Util.pm 13653 2007-10-22 09:11:20Z gr $

use strict;
use warnings;
use Error::Hierarchy::Util 'assert_class';


our $VERSION = '0.04';


use base 'Exporter';


our %EXPORT_TAGS = (
    misc => [ qw{assert_object_type} ],
);

our @EXPORT_OK = @{ $EXPORT_TAGS{all} = [ map { @$_ } values %EXPORT_TAGS ] };


# pass an OBJ_* constant to this method

sub assert_object_type ($$) {
    my ($obj, $object_type_const) = @_;
    local $Error::Depth = $Error::Depth + 1;
    assert_class($obj, Class::Scaffold::Environment->getenv->
        get_class_name_for($object_type_const)
    );
}


1;


__END__

{% USE p = PodGenerated %}

=head1 NAME

{% p.package %} - large-scale OOP application support

=head1 SYNOPSIS

    {% p.package %}->new;

=head1 DESCRIPTION

=head1 METHODS

=over 4

{% p.write_methods %}

=back

{% p.write_inheritance %}

{% PROCESS standard_pod %}

=cut

